package xinxin.com.StatePattern.State.StateDetail;

import xinxin.com.StatePattern.State.State;
import xinxin.com.StatePattern.Work.Work;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/3/26 10:57
 */
public class AfternoonState extends State {
    @Override
    public void WriteProgram(Work w) {
        if (w.getHour() < 17) {
            System.out.println("当前时间：" + w.getHour() + "点 下午状态还不错，继续努力");
        } else {
            w.setState(new EveningState());
            w.WriteProgram();
        }
    }
}
